/**
 * 
 */
package kernel_gui.interfaces.kernel_gui;

import common.entities.nonpersistent.GameQuestion;

/**
 * @author Yoyo
 *
 */
public interface IGame {
	/**
	 * Initializes a new game
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Boolean value 'true'
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * 
	 */
	void startGame(int requestId);
	
	/**
	 * Is there a next question?
	 * 
	 * @return true if there are more questions or false if we have reached the last question in the game
	 */
	boolean hasNextQuestion();
	
	/**
	 * Get the next question
	 * 
	 * @return the next question in the game
	 */
	GameQuestion nextQuestion();
	
	/**
	 * Checks if the answer chosen matches the current question's answer
	 * 
	 * @param answerNumber
	 * @return true if the answers matches, otherwise, false
	 */
	boolean submitAnswer(int answerNumber);
		
	/**
	 * Help-wheel: replace the current question with a new question.
	 * 
	 * @return a question that will replace the current question in the game
	 */
	GameQuestion helpWheelReplaceQuestion();
	
	/**
	 * Help-wheel: randomly chooses a group of wrong answers. 
	 * The group size shall be half the number of answers to a question 
	 * 
	 * @return the indexes of the wrong answers in the answers array
	 */
	int[] helpWheelFiftyFifty();
	
	/**
	 * Help-wheel: extends the current question time-to-answer 
	 * 
	 * @return the given-extra-time in seconds
	 */
	int helpWheelExtraTime();
	
	/**
	 * Ends a game
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with int value of total score int the game
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 */
	void endGame(int requestId);
	
}
